package cn.fuxi2022.accounts.activity.controller;

import cn.fuxi2022.accounts.activity.service.GroupActivityCountService;
import cn.fuxi2022.model.resp.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/activity/count")
public class GroupActivityCountController {

    @Autowired
    private GroupActivityCountService groupActivityCountService;

    @GetMapping
    public R getCount() {
        return R.ok().data(groupActivityCountService.groupActivityCount());
    }

    @GetMapping("refresh")
    public R refresh() {
        groupActivityCountService.groupActivityRefresh();
        return R.ok();
    }
}
